package com.hntech.base.io.bio.v2;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Autho changqi.wu
 * @Date 路在脚下，使劲踩！
 */
public class BioServer {

    public static int port = 8000;
    public static String address = "127.0.0.1";

    public static void main(String[] args) throws IOException {

        ServerSocket server = new ServerSocket(port);

        System.out.println("start server " + port);

        while (true) {
            Socket socket = server.accept();
            System.out.println("connect comming in " + socket.getInetAddress());
            new Thread(new IOHandler(socket)).start();

        }
    }

}
